package com.zzyl.controller.customer;

import com.zzyl.base.PageResponse;
import com.zzyl.base.ResponseResult;
import com.zzyl.service.NursingProjectService;
import com.zzyl.vo.NursingProjectVo;
import io.swagger.annotations.Api;
import io.swagger.annotations.ApiOperation;
import lombok.RequiredArgsConstructor;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.PathVariable;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.RestController;

@Api(tags = "客户订单项目管理")
@RestController
@RequiredArgsConstructor
@RequestMapping("/customer/orders/project")
public class CustomerOrderProjectController {

    private final NursingProjectService nursingProjectService;

    @GetMapping(path = "page")
    @ApiOperation("分页查询护理项目列表")
    public ResponseResult<PageResponse<NursingProjectVo>> findNursingProjectPage(String name, Integer status, Integer pageNum, Integer pageSize){
        return ResponseResult.success(nursingProjectService.findNursingProjectPage(name, status, pageNum, pageSize));
    }

    @GetMapping(path = "/{id}")
    @ApiOperation("根据id查询护理项目")
    public ResponseResult<NursingProjectVo> findNursingProjectById(@PathVariable Long id){
        return ResponseResult.success(nursingProjectService.findNursingProjectById(id));
    }
}
